package com.lvtongka.app.base

import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import com.lvtongka.app.common.listener.RefreshCallback
import com.lvtongka.app.helper.SPHelper
import com.lvtongka.app.helper.SPKConstants

open class BaseViewModel : ViewModel() {
    // 错误回调
    protected val _error = MutableLiveData<String>()
    val error: LiveData<String> = _error

    // 券二维码界面错误回调
    protected val _error2 = MutableLiveData<String>()
    val error2: LiveData<String> = _error2

    fun getAccessToken() : String {
        return SPHelper.getString(SPKConstants.LOGIN_ACCESS_TOKEN,"") + ""
    }
}